/*
 * FormaAleta.h
 *
 *  Created on: 24/10/2013
 *      Author: ezequiel
 */

#ifndef FORMAALETA_H_
#define FORMAALETA_H_
#include <vector>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform2.hpp>
#include <glm/gtx/projection.hpp>
#include <iostream>
#include <fstream>
#include "../Camara.h"
#include "../Dibujable.h"
#include <vector>
#include "../CurvaBessier.h"
#include "../CurvaSpline.h"

class FormaAleta : public Dibujable {
public:
	FormaAleta();
	virtual ~FormaAleta();
	 void render(GLuint handle, glm::mat4* matModelo);
	 void render(GLuint handle);
private:
//		GLfloat* aleta_vertex_buffer;
//		GLfloat* aleta_normal_buffer;
//		GLuint* aleta_index_buffer;
//		GLfloat* aleta_texture_buffer;
//		unsigned int aleta_vertex_buffer_size;
//		unsigned int aleta_normal_buffer_size;
//		unsigned int aleta_index_buffer_size;
		GLfloat* planta_vertex_buffer;
		GLfloat* planta_normal_buffer;
		GLfloat* planta_texture_buffer;
		GLuint* planta_index_buffer;
		unsigned int planta_vertex_buffer_size;
		unsigned int planta_normal_buffer_size;
		unsigned int planta_index_buffer_size;
		float pControl1, pControl2;
		int alturaPlanta;
		void indexar();
		void indexarPuntos();
		void calcularNormales();
		glm::vec3 calcularNormal(glm::vec3 vec1, glm::vec3 vec2);
		void crearForma();

};

#endif /* FORMAALETA_H_ */
